
import { PropType, defineComponent, inject } from 'vue';

import { IProvideExpose } from '.';

import { showSlot } from '~/src/utils/hooks';
import Style from "./index.module.scss";
import { ElCheckTag } from 'element-plus';

export default defineComponent({
    props: {
        /** 值 */
        value: {
            type: Object as PropType<number | string>,
            required: true
        },
        /** 显示的内容 */
        label: {
            type: Object as PropType<number | string>,
            required: false
        }
    },
    setup(props, { slots, attrs }) {

        const buttonSelect = inject("buttonSelect") as IProvideExpose;


        return () => (<>

            <div class={[Style.but]} {...attrs} onClick={()=>{
                buttonSelect.callBack(props)
            }}>
                {props.label ? props.label : showSlot(slots)}
            </div>
        </>);
    }
})
